package com.xbongbong.paas.pojo.dto;

import com.xbongbong.paas.enums.DelEnum;
import com.xbongbong.paas.enums.MenuTypeEnum;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.QueryIgnore;
import com.xbongbong.pro.enums.SaasMarkEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author: wufeng
 * @date: 2018/8/7 19:47
 * @desrcption: 新建分组
 */
@Setter
@Getter
@ToString
public class MenuGroupAddDTO extends BaseDTO {

    private static final long serialVersionUID = -1073231930280340759L;
    /**
     * 应用id
     */
    @NotNull(message = "{dto.msg.menuGroupAdd.appId.NotNull}")
    private Long appId;

    /**
     * 分组名称
     */
    @NotBlank(message = "{dto.msg.menuGroupAdd.name.NotBlank}")
    @Length(max = 50, message = "{dto.msg.menuGroupAdd.name.Length}")
    @Getter(onMethod_ = {@QueryIgnore})
    private String name;

    /**
     * 分组名称英文版
     */
    @NotBlank(message = "{dto.msg.menuGroupAdd.name.NotBlank}")
    @Length(max = 50, message = "{dto.msg.menuGroupAdd.name.Length}")
    @Getter(onMethod_ = {@QueryIgnore})
    private String nameEn;

    /**
     * 分组类型 1 分组，2 表单，3 表单(开启流程)，4 统计
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer type;

    /**
     * 父类id
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Long parentId;

    /**
     * 应用图标
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private String icon;

    /**
     * 颜色，16进制色，如 FF0000
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private String color;

    /**
     * 排序
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private Integer sort;

    /**
     * 业务
     * @see com.xbongbong.saas.enums.XbbRefTypeEnum
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private String alias;

    /**
     * 访问地址
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private String url;
    /**
     * 手机端访问地址
     */
    @Getter(onMethod_ = {@QueryIgnore})
    private String mobileUrl;

    private Integer del;

    /**
     * 是否启用 1：启用，0：不启用
     */
    private Integer enable;

    @Getter(onMethod_ = {@QueryIgnore})
    private Integer saasMark;

    public MenuGroupAddDTO() {
        super();
        //默认前端传过来的应用为自建应用
        parentId = 0L;
        name = "未命名分组";
        icon = "";
        color = "";
        alias = "";
        url = "";
        mobileUrl = "";
        enable = 1;
        type = MenuTypeEnum.GROUP.getType();
        del = DelEnum.NORMAL.getDel();
        saasMark = SaasMarkEnum.PAAS.getCode();
    }
}
